﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using XinLife.Core.Caches;

namespace XinLife.Core.Setup
{
    public static class CacheSetup
    {
        /// <summary>
        /// 统一注册缓存
        /// </summary>
        /// <param name="services"></param>
        public static void AddCacheSetup(this IServiceCollection services)
        {
            //使用内存
            services.AddMemoryCache();
            services.AddDistributedMemoryCache();
            services.AddSingleton<ICaching, Caching>();
        }
    }
}
